package net.daum.webtoon.android;

import java.util.concurrent.ExecutionException;

import net.daum.webtoon.android.io.DaumWebToonsInitTask;
import net.daum.webtoon.android.io.RESTFulClient;
import net.daum.webtoon.android.util.Logger;
import net.daum.webtoon.android.util.ToastUtil;

import org.json.JSONObject;

import android.app.Activity;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;

public class IntroActivity extends Activity {

	private static final String TAG = IntroActivity.class.getSimpleName();
	DaumWebToonsInitTask task;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_intro);
		task = new DaumWebToonsInitTask(this, 30, new Runnable() {

			@Override
			public void run() {
				Intent intent = new Intent(IntroActivity.this,
						WebToonAllGridActvity.class);
				try {
					intent.putExtra("data", task.get().toString());
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (ExecutionException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				startActivity(intent);
			}
		});
		task.execute(new JSONObject());
	}

}
